<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.biz.utils.ConfigUtil" %>
	<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
    String resoursUrl = ConfigUtil.get("RESOURCES_URL");
%>

<!doctype html>
<html class="no-js"  style=" background: -webkit-gradient(linear, 0% 0%, 0% 100%,from(#70b1c9), to(#5967c3)); padding-bottom:50px;">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>个人中心</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="format-detection" content="telephone=no" />
	<link rel="stylesheet" href="<%=resoursUrl%>resources/assets/css/dxy.css" />
  <jsp:include page="/jsp/inc_head.jsp"></jsp:include>
<style>
</style>
</head>

<body class="grzxbody" style=" padding-bottom:80px;">
<div class="am-g" style="padding:20px 10px 10px;">
	<div class="am-u-sm-12 grxz_top">
		<div class="am-u-sm-12 am-text-center am-pad-none">
			<img id="headWX" src="" class="grzx_toux"/>
			<div id="name" class="grzx_name">E-</div>
		</div>
	</div>

	<div class="am-u-sm-12 am-pad-none grxz_hyzl">
		<div class="am-u-sm-12 hyzl_tex">
			会员资料
		</div>
		<div class="am-u-sm-12 jf_list_two" onclick="toMyOrder()">
			<div class="am-u-sm-11 am-pad-none">
				我的订单
			</div>
			<div class="am-u-sm-1 am-pad-none am-text-right">
				<img src="<%=resoursUrl%>resources/assets/image/icon_right.png"/>
			</div>
		</div>
	</div>

	<div class="am-u-sm-12 am-pad-none grxz_hyzl">
		<div class="am-u-sm-12 hyzl_tex">
			收货地址
		</div>
		<div class="am-u-sm-12 jf_list_two" onclick="toAddress()">
			<div class="am-u-sm-11 am-pad-none">
				地址管理
			</div>
			<div class="am-u-sm-1 am-pad-none am-text-right">
				<img src="<%=resoursUrl%>resources/assets/image/icon_right.png"/>
			</div>
		</div>
	</div>

	<div class="am-u-sm-12 am-pad-none grxz_hyzl">
		<div class="am-u-sm-12 hyzl_tex">
			会员资料
		</div>
		<div class="am-u-sm-12 jf_list_two" onclick="toMyAccount()">
			<div class="am-u-sm-4 am-pad-none">
				<img src="<%=resoursUrl%>resources/assets/image/icon_rztel.png" width="12"/>&nbsp;&nbsp;认证手机
			</div>
			<div class="am-u-sm-7 am-pad-none">
				<div class="telnumber" id="userPhone"></div>
			</div>
			<div class="am-u-sm-1 am-pad-none am-text-right">
				<a>
					<img src="<%=resoursUrl%>resources/assets/image/icon_pen.png" height="16"/>
				</a>
			</div>
		</div>
		<div class="am-u-sm-12 jf_list_two" onclick="toBirthDay()">
			<div class="am-u-sm-4 am-pad-none" >
				<img src="<%=resoursUrl%>resources/assets/image/icon_hysr.png" width="12"/>&nbsp;&nbsp;会员生日
			</div>
			<div class="am-u-sm-7 am-pad-none">
				<div class="add_tip" id="userBir">点击添加生日</div>
			</div>
			<div class="am-u-sm-1 am-pad-none am-text-right">
				<a>
					<img src="<%=resoursUrl%>resources/assets/image/icon_plus.png" height="16"/>
				</a>
			</div>
		</div>
		<div class="am-u-sm-12 jf_list_two" style="border-bottom:0;" onclick="toRecord()">
			<div class="am-u-sm-11 am-pad-none">
				<img src="<%=resoursUrl%>resources/assets/image/icon_dhjl.png" width="12"/>&nbsp;&nbsp;会员支付记录
			</div>
			<div class="am-u-sm-1 am-pad-none am-text-right">
				<img src="<%=resoursUrl%>resources/assets/image/icon_right.png"/>
			</div>
		</div>
	</div>
	<div class="am-u-sm-12 am-pad-none grxz_hyzl">
		<div class="am-u-sm-12 hyzl_tex">
			我的久零券
		</div>
		<div class="am-u-sm-12 grzx_midxx">
			<div class="am-u-sm-4 am-pad-none am-text-center midxx_li">
				消费次数<br/>
				<span class="xx_col" id="xfcs">0</span>
			</div>
			<div class="am-u-sm-4 am-pad-none am-text-center midxx_li">
				累计金额<br/>
				<span class="xx_col" id="ljje">0.00</span>
			</div>
			<div class="am-u-sm-4 am-pad-none am-text-center midxx_li" style="border-right:0;">
				当前余额<br/>
				<span class="xx_col" id="dqye">0.00</span>
			</div>
		</div>
		<a onclick="toDetail()">
			<div class="am-u-sm-12 jf_list_two">
				<div class="am-u-sm-11 am-pad-none">
					<img src="<%=resoursUrl%>resources/assets/image/icon_dhjl.png" width="12"/>&nbsp;&nbsp;久零券明细
				</div>
				<div class="am-u-sm-1 am-pad-none am-text-right">
					<img src="<%=resoursUrl%>resources/assets/image/icon_right.png"/>
				</div>
			</div>
		</a>
		<a onclick="toPayCode()">
			<div class="am-u-sm-12 jf_list_two">
				<div class="am-u-sm-11 am-pad-none">
					<img src="<%=resoursUrl%>resources/assets/image/icon_dhjl.png" width="12"/>&nbsp;&nbsp;久零券付款码
				</div>
				<div class="am-u-sm-1 am-pad-none am-text-right">
					<img src="<%=resoursUrl%>resources/assets/image/icon_right.png"/>
				</div>
			</div>
		</a>
		<a onclick="toRecharegCard()">
			<div class="am-u-sm-12 jf_list_two">
				<div class="am-u-sm-11 am-pad-none">
					<img src="<%=resoursUrl%>resources/assets/image/icon_dhjl.png" width="12"/>&nbsp;&nbsp;充值卡
				</div>
				<div class="am-u-sm-1 am-pad-none am-text-right">
					<img src="<%=resoursUrl%>resources/assets/image/icon_right.png"/>
				</div>
			</div>
		</a>
        <c:if test="${type==1}">
            <a onclick="toGetCard()">
                <div class="am-u-sm-12 jf_list_two">
                    <div class="am-u-sm-11 am-pad-none">
                        <img src="<%=resoursUrl%>resources/assets/image/icon_dhjl.png" width="12"/>&nbsp;&nbsp;扫码消券
                    </div>
                    <div class="am-u-sm-1 am-pad-none am-text-right">
                        <img src="<%=resoursUrl%>resources/assets/image/icon_right.png"/>
                    </div>
                </div>
            </a>
        </c:if>
	</div>


</div>
<!--footer-->
<jsp:include page="/jsp/inc_bottom.jsp"></jsp:include>
<!--footer-->
<div class="am-modal am-modal-alert" tabindex="-1" id="my-alert">
	<div class="am-modal-dialog">
		<div class="am-modal-hd" id="alert_title">哎呦喂，出错啦</div>
		<div class="am-modal-bd" id="alert_message"></div>
		<div class="am-modal-footer">
			  <span class="am-modal-btn">确定</span>
		</div>
	</div>
</div>
<script>
     var ajaxpath="${pageContext.request.contextPath}";
     $(function () {
		 loadUserInfo();
		 loadJNInfo();
         wx.config({
             debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
             appId: '${appId}', // 必填，公众号的唯一标识
             timestamp: '${ timestamp}' , // 必填，生成签名的时间戳
             nonceStr: '${ nonceStr}', // 必填，生成签名的随机串
             signature: '${ signature}',// 必填，签名，见附录1
             jsApiList: ['checkJsApi',
                 'scanQRCode'// 微信扫一扫接口
             ] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
         });
     });
     
     function loadUserInfo()
	 { //查询用户信息
		 var url=ajaxpath+"/userCenter/getUserCenterInfo.do";
		 $.get(url,function(data){
			 if(data==null||data==""){
				 $("#alert_message").html("绑定信息有误，请联系客服！");
				 $("#my-alert").modal('open');
			 }else{
				 if(data.personName==""||data.personName==null){
					 $("#name").html(" ");
				 }else{
					 $("#name").html(data.personName);
				 }
				 if(data.phone==""||data.phone==null){
					 $("#userPhone").html(" ");
				 }else{
					 $("#userPhone").html(data.phone);
				 }
				 if(data.birthDay==""||data.birthDay==null){
				 }else{
					 $("#userBir").html(data.birthDay);
				 }

				 if(data.headimgurl==""||data.headimgurl==null){
					 $("#headWX").attr("src","<%=resoursUrl%>resources/assets/image/grcenter_tx.png");
				 }else{
					 $("#headWX").attr("src",data.headimgurl);
				 }
			 }
		 });
	 }

	 function loadJNInfo()
	 {
		 var url=ajaxpath+"/userCenter/getUserCenterJNInfo.do";
		 $.get(url,function(data){
			if(data.return_data!=undefined&&data.return_data!=null)
			{
				$("#xfcs").html(data.return_data.pay_cnt_90);
				$("#ljje").html((data.return_data.balance_90_total/100).toFixed(2));
				$("#dqye").html((data.return_data.balance_90/100).toFixed(2));
			}
		 });
	 }
     //跳转个人资料页
     function toMyInfo(){
           window.location.href = ajaxpath+"/client_toClientInfo.do?guid="+ new Date(); 
     }
     //跳转我的账号页
     function toMyAccount(){
           window.location.href = ajaxpath+"/client_toAccountband.do?guid="+ new Date(); 
     }
     //跳转我的优惠券页
     function toMycoupons(){
           window.location.href = ajaxpath+"/client_toMycoupons.do?guid="+ new Date(); 
     }
     //跳转我的收藏页
     function toMycollection(){
           window.location.href = ajaxpath+"/client_toMycollection.do?guid="+ new Date(); 
     }
     //跳转收获地址
     function toAddress(){
           window.location.href = ajaxpath+"/client_toAddress.do?guid="+ new Date(); 
     }
     //跳转会员等级
     function toMemberRating(){
           window.location.href = ajaxpath+"/client_toMemberRating.do?guid="+ new Date(); 
     }
     //跳转我的积分
     function toMyIntegral(){
           window.location.href = ajaxpath+"/client_toMyIntegral.do?guid="+ new Date(); 
     }
	 //跳转我的生日
	 function toBirthDay(){
		 window.location.href = ajaxpath+"/client_toBirthDay.do?guid="+ new Date();
	 }
     //跳转我订单
     function toMyOrder(){
           window.location.href = ajaxpath+"/jsp/order/orderList.jsp?guid="+ new Date();
     }

	 //跳转90明细
	 function toRecord(){
		 window.location.href = ajaxpath+"/jsp/client/record_90.jsp?guid="+ new Date();
	 }
	 //跳转90体验店记录
	 function toDetail(){
		 window.location.href = ajaxpath+"/jsp/client/detail_90.jsp?guid="+ new Date();
	 }
	 //跳转充值卡
	 function toRecharegCard(){
		 window.location.href = ajaxpath+"/jsp/client/rechargeCard_90.jsp?guid="+ new Date();
	 }
	 //跳转支付码
	 function toPayCode(){
		 window.location.href = ajaxpath+"/jsp/client/payCode_90.jsp?guid="+ new Date();
	 }
    //弹出二维码扫描
     function toGetCard(){
         wx.scanQRCode({
             needResult: 0, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
             scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码，默认二者都有
             success: function (res) {
                 var result = res.resultStr; // 当needResult 为 1 时，扫码返回的结果
             }
         })
     }

     
</script>
</body>
</html>
